package com.onclick.webchat.websocketInterface;

import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketMessage;
import org.springframework.web.socket.WebSocketSession;

public interface UserSocketIntface {
	/**
	 * 用户登陆操作
	 * @param session
	 */
     void afterConnectionEstablished(WebSocketSession session);
     /**
      * 用户信息处理
      * @param session
      * @param message
      */
     void handleMessage(WebSocketSession session, WebSocketMessage<?> message);
     /**
      * 通讯异常处理
      * @param session
      * @param exception
      */
     void handleTransportError(WebSocketSession session,Throwable exception);
     /**
      * 用户下线处理
      * @param session
      * @param closeStatus
      */
     void afterConnectionClosed(WebSocketSession session,CloseStatus closeStatus);
     /**
      * 系统消息广播
      * @param message
      */
     void broadcast(final TextMessage message);
     /**
      * 单独聊天
      * @param uid
      * @param message
      */
     void sendMessageToUser(String uid, TextMessage message);
     /**
      * 群聊天
      * @param flockUid
      * @param message
      */
     void pushMessageToFlock(String flockUid, TextMessage message);
}
